import { request } from 'umi';

export let getArticleList = (page: number = 1) => {
  return request('/api/article', {
    params: {
      page,
      pageSize: 12,
      status: 'publish',
    },
  });
};

export let getArticleRecommend = () => {
  return request('/api/article/recommend');
};

// 获取文章分类
export let getArticleCatrgory = () => {
  return request('/api/category', {
    params: {
      articleStatus: 'publish',
    },
  });
};

// 获取归档列表
export let getArchiveList = () => {
  return request('/api/article/archives');
};

// 获取标签列表
export function getTagList() {
  return request('/api/tag');
}
